package com.nanhai.buddhist.college.module.study.dal.mysql.studyevaluationscoreitem;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.study.dal.dataobject.studyevaluationscoreitem.StudyEvaluationScoreItemDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.study.controller.admin.studyevaluationscoreitem.vo.*;

/**
 * 评分配置 Mapper
 *
 * @author 南海佛学院
 */
@Mapper
public interface StudyEvaluationScoreItemMapper extends BaseMapperX<StudyEvaluationScoreItemDO> {

    default PageResult<StudyEvaluationScoreItemDO> selectPage(StudyEvaluationScoreItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StudyEvaluationScoreItemDO>()
                .eqIfPresent(StudyEvaluationScoreItemDO::getScoreLevel, reqVO.getScoreLevel())
                .eqIfPresent(StudyEvaluationScoreItemDO::getItemScore, reqVO.getItemScore())
                .eqIfPresent(StudyEvaluationScoreItemDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(StudyEvaluationScoreItemDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(StudyEvaluationScoreItemDO::getOrgId, reqVO.getOrgId())
                .orderByDesc(StudyEvaluationScoreItemDO::getId));
    }

    default List<StudyEvaluationScoreItemDO> selectList(StudyEvaluationScoreItemExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<StudyEvaluationScoreItemDO>()
                .eqIfPresent(StudyEvaluationScoreItemDO::getScoreLevel, reqVO.getScoreLevel())
                .eqIfPresent(StudyEvaluationScoreItemDO::getItemScore, reqVO.getItemScore())
                .eqIfPresent(StudyEvaluationScoreItemDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(StudyEvaluationScoreItemDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(StudyEvaluationScoreItemDO::getOrgId, reqVO.getOrgId())
                .orderByDesc(StudyEvaluationScoreItemDO::getItemScore));
    }

}
